package com.ycxy.sh.transaction.mapper;

import com.ycxy.sh.transaction.dao.entity.Commodity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商品接口类
 * @author hlt
 * @since 2019-12-21
 */
@Repository
public interface CommodityMapper {
    /**插入商品*/
    int InsertCommodity(Commodity commodity);
    /**根据商品id查询商品详情*/
    Commodity selectById(Commodity commodity);
    /**修改商品*/
    int updateCommodity(Commodity commodity);
    /**修改商品状态*/
    int ChangeCommstatus(@Param("commodityId") Long commodityId, @Param("commodityStatus") Integer commodityStatus);
    /**通过商品名分页模糊查询*/
    List<Commodity> queryCommodityByName(@Param("page") Integer page, @Param("count") Integer count, @Param("commodityName") String commodityname);
    /**模糊查询商品总数*/
    int queryCommodityByNameCount(@Param("commname") String commname);
    /**分页展示各类状态的商品信息*/
    List<Commodity> queryAllCommodity(@Param("page") Integer page, @Param("count") Integer count, @Param("userid") Long userid, @Param("commodityStatus") Integer commoditystatus);
    /**查询商品各类状态的总数*/
    int queryCommodityCount(@Param("userid") Long userid, @Param("commStatus") Integer commStatus);
    /**首页分类展示8条商品*/
    List<Commodity> queryCommodityByCategory(@Param("commodityCategory") String commodityCategory);
    /**产品清单分类分页展示商品*/
    List<Commodity> queryAllCommodityByCategory(@Param("page") Integer page, @Param("count") Integer count, @Param("area") String area, @Param("productLocation") String productlocation,
                                                @Param("commodityCategory") String category, @Param("minmoney") BigDecimal minmoney, @Param("maxmoney") BigDecimal maxmoney);
    /**查询产品清单分类分页展示商品的总数*/
    int queryAllCommodityByCategoryCount(@Param("area") String area, @Param("productLocation") String productlocation, @Param("commodityCategory") String category,
                                             @Param("minmoney") BigDecimal minmoney, @Param("maxmoney") BigDecimal maxmoney);
}